package top.aigoo.project01.enums;

/**
 * @Description: 店铺类别
 * @Author: Mr.OYSHUO.欧阳大叔  mail:1642302522@qq.com
 * @Version 1.0.0
 * @Date: 2021/9/2 0:30
 */
public enum ShopCategoryStateEnum {
    SUCCESS(0, "创建成功"),
    INNER_ERROR(-1001, "操作失败"),
    EMPTY(-1002, "区域信息为空");

    private int state;

    private String stateInfo;

    private ShopCategoryStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {
        return state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public static ShopCategoryStateEnum stateOf(int index) {
        for (ShopCategoryStateEnum state : values()) {
            if (state.getState() == index) {
                return state;
            }
        }
        return null;
    }
}
